﻿<include file="Head" />
<div id="mo-body-left">
    <div class="mo-box-left hslice" id="article-{$id}">
        <div class="mo-box-left-content">
            <h2 class="entry-title"><a href="{$$MO_ROOT}<rewrite>?m=home&a=show&id={$id}</rewrite>">{$Title}</a></h2>
            <h3>{$AddDate:F.formatdate="yyyy年M月d日"} 分类：<a href="{$$MO_ROOT}<rewrite>?m=home&a=cats&cat={$ClassID}</rewrite>">{$ClassName}</a><gt name="views" value="0"> 浏览：{$views}次</gt> 分享：<a href="javascript:share();">人人</a></h3>
            <div class="mo-box-left-diary entry-content">{$Content}</div>
            <div class="mo-box-left-foot">
            <ul>
            <li><span>来源：</span>{$FromU}</li>
            <li><span>标签：</span>{$Tags:Mo.Common.ActTags=true}</li>
            <li><span>上一篇：</span><nempty name="Last"><a href="{$$MO_ROOT}<rewrite>?m=home&a=show&id={$Last.id}</rewrite>">{$Last.Title}</a></else>已经木有相关文章了！</nempty></li>
            <li><span>下一篇：</span><nempty name="Next"><a href="{$$MO_ROOT}<rewrite>?m=home&a=show&id={$Next.id}</rewrite>">{$Next.Title}</a></else>已经木有相关文章了！</nempty></li>
            <li><span>引用通告：</span><a href="{$System.blog_hostname}{$$MO_ROOT}<rewrite>?m=home&a=trackback_ping&id={$id}</rewrite>" target="_blank">{$System.blog_hostname}{$$MO_ROOT}<rewrite>?m=home&a=trackback_ping&id={$id}</rewrite></a>，被引用<a href="{$$MO_ROOT}<rewrite>?m=home&a=trackbacks&id={$id}</rewrite>" target="_blank">{$trackback_count}</a>次</li>
            </ul>
            </div>
        </div>
    </div>
    <script type="text/javascript">
	function share(){
		var url=encodeURIComponent(window.location.href);
		image=encodeURIComponent(F("div.entry-content img:first").attr("src"));
		if(image!="" && image.indexOf("http://")!=0)image = "{$System.blog_hostname}" + image;
		var content=encodeURIComponent(F("div.entry-content").text());
		var title=encodeURIComponent("{$Title}");
		var _u = 'http://widget.renren.com/dialog/share?title=' + title + '&pic=' + (image) + '&resourceUrl=' + (url) + '&description=' + (content);		
		wopen(_u);
	}
	function wopen(url){
		window.open( url,'', 'width=700, height=600,top=50, toolbar=no, menubar=no, scrollbars=yes, location=yes, resizable=yes, status=no' );
	}
	</script>
    <eq name="can_comment" value="yes">
    <a name="comments"></a>
    <div class="mo-box-left mo-comments-title">
        <div class="mo-box-left-content">
            <h2>文章评论</h2>
        </div>
    </div>
    <loop name="aComments" eof="&lt;div class="mo-box-eof"&gt;恭喜，沙发是你的了！&lt;/div&gt;">
    <a name="c{$aComments.id}"></a>
    <div class="mo-box-left mo-comments">
        <div class="mo-box-left-content">
            <h4><nempty name="aComments.email"><img src="http://www.gravatar.com/avatar/{$aComments.email:Md5}?s=32&r=G&d=http%3A%2F%2Fwww.9fn.net%2FImages%2Fnofind.jpg" alt="{$aComments.name}" /></nempty>
            <nempty name="aComments.homepage"><a href="{$aComments.homepage}" target="_blank">{$aComments.name:Server.HtmlEncode}</a></else>{$aComments.name:Server.HtmlEncode}</nempty>&nbsp; <span>[{$aComments.ly_date:F.formatdate="yyyy-MM-dd HH:mm:ss"}]</span></h4>
            <div class="mo-box-left-diary">{$aComments.content:Server.HtmlEncode}</div>
            <nempty name="aComments.rely">
            <div class="box-replay">
            	<h3>[{$aComments.ly_date:F.formatdate="yyyy-MM-dd HH:mm:ss"}]回复：</h3>
                <div class="replay-content">{$aComments.rely}</div>
            </div>
            </nempty>
        </div>
    </div>
    </loop>
    <div class="pagestr"><page for="aComments" url="{$$MO_ROOT}<rewrite>?m=home&a=show&id={$#id}&page={#page}</rewrite>" /></div>
    <div class="mo-box-left">
        <div class="mo-box-left-content">
            <h4>评论文章</h4>
            <div class="mo-box-left-diary">
            <form action="{$$MO_ROOT}{$$MO_APP_ENTRY}?m=home&a=savecomment" method="post" onsubmit="return CheckGuestPost(this);">
                <input type="hidden" name="pid" value="{$id}" />
                <h3>评论内容：</h3>
                <textarea type="text" class="inputTextUser width_450 height_100" name="content"></textarea> * 这个得填！
                <h3>您的名字：</h3>
                <input type="text" class="inputText width_150" name="name" value="匿名" onfocus="if(this.value=='匿名')this.value='';" onblur="if(this.value=='')this.value='匿名';" /> 这个可以填哈~
                <h3>您的邮箱：</h3>
                <input type="text" class="inputText width_150" name="email" /> 回复您的时候您可以收到邮件的~
            	<h3>您的主页：</h3>
                <input type="text" class="inputText width_150" name="homepage" value="http://" />
                <h3>验证码：</h3>
                <input type="text" class="inputText width_90" name="code" />
                <img id="code" style="border:1px solid #666; padding:6px; cursor:pointer" src="{$$MO_ROOT}{$$MO_APP_ENTRY}?m=home&a=safecode" title="点击刷新验证码" onclick="this.src='{$$MO_ROOT}{$$MO_APP_ENTRY}?m=home&a=safecode&r=' + Math.random()" />
                <input type="checkbox" name="secret" value="yes" /> 只给管理员看
                <input type="submit" class="inputButton" value="提交评论" />
            </form>
            <script type="text/javascript">
            function CheckGuestPost(frm){
                if(frm['content'].value==""){MessageBox.showError('请填写评论内容啦！');return false;}
                if(frm['content'].value.length>512){MessageBox.showError('评论内容太多咯！');return false;}
                if(frm['name'].value!="" && frm['name'].value.length>30){MessageBox.showError('咦？您的名字这么长的？');return false;}
                if(!/\w{4}/i.test(frm['code'].value)){MessageBox.showError('请填写正确的验证码！');return false;}
				F.ajax({
					form:frm,
					succeed:function(msg){
						if(msg.indexOf("成功提交啦")>=0){
							MessageBox.showInformation(msg);
							window.setTimeout(function(){window.location.reload();},1000);
						}else{
							MessageBox.showError(msg);
							F("#code").attr("src","{$$MO_ROOT}{$$MO_APP_ENTRY}?m=home&a=safecode&r=" + Math.random());
						}
					},
					error:function(){
						MessageBox.showError("哎呀，服务器错误啦！");
						F("#code").attr("src","{$$MO_ROOT}{$$MO_APP_ENTRY}?m=home&a=safecode&r=" + Math.random());
					}
				});
				return false;
            }
			F(function(){   
				F("pre.prettyprint").each(function(i){
					var pre = this;  
					pre.id="code_" + i;
					var cls = pre.className||"";
					if(cls.indexOf("prettyprint")>=0 && cls.indexOf("lang-")>=0){
						var lng = cls.replace(/^(.+?)lang\-(.+?)( (.+?))?$/,"$2");
						var h3 = document.createElement("h3");
						h3.className="lang_type";
						h3.innerHTML=lng+" 代码[<a href=\"javascript:F.copy(F('#" + pre.id + "').text());\">复制</a>]：";
						pre.parentNode.insertBefore(h3,pre);
					}
				});
			});
            </script>
            </div>
        </div>
	</div>
    </else>
    <div class="mo-box-left mo-linkstext">
        <div class="mo-box-left-content">
            <h2>哎呀！管理员关闭了评论！</h2>
        </div>
    </div>    
    </eq>
</div>
<include file="Right" />
<include file="Foot" />